from time import sleep
from selenium import webdriver
from selenium.webdriver.common.by import By

driver = webdriver.Chrome()

# 打开百度页面
driver.get("http://www.baidu.com")
sleep(3)
driver.get("https://www.163.com")

# 浏览器操作
sleep(2)
driver.back()  # 后退
sleep(2)
driver.forward()  # 前进
sleep(2)
driver.refresh()  # 刷新

# 关闭浏览器
sleep(5)
driver.quit()
